﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Camc.Quality.Migrations
{
    public partial class remove_rwork : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_RFormBases_RWorkStepEntities_RWorkStepEntityId",
                table: "RFormBases");

            migrationBuilder.DropForeignKey(
                name: "FK_RLoadPieceEntities_RWorkStepEntities_RWorkStepEntityId",
                table: "RLoadPieceEntities");

            migrationBuilder.DropIndex(
                name: "IX_RLoadPieceEntities_RWorkStepEntityId",
                table: "RLoadPieceEntities");

            migrationBuilder.DropIndex(
                name: "IX_RFormBases_RWorkStepEntityId",
                table: "RFormBases");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "IX_RLoadPieceEntities_RWorkStepEntityId",
                table: "RLoadPieceEntities",
                column: "RWorkStepEntityId");

            migrationBuilder.CreateIndex(
                name: "IX_RFormBases_RWorkStepEntityId",
                table: "RFormBases",
                column: "RWorkStepEntityId");

            migrationBuilder.AddForeignKey(
                name: "FK_RFormBases_RWorkStepEntities_RWorkStepEntityId",
                table: "RFormBases",
                column: "RWorkStepEntityId",
                principalTable: "RWorkStepEntities",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_RLoadPieceEntities_RWorkStepEntities_RWorkStepEntityId",
                table: "RLoadPieceEntities",
                column: "RWorkStepEntityId",
                principalTable: "RWorkStepEntities",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
